import { Breadcrumb as AntBreadcrumb } from 'antd'

const { Item } = AntBreadcrumb

interface BreadcrumbProps extends React.ComponentProps<typeof AntBreadcrumb> {
  items: Array<React.ComponentProps<typeof Item>>
}

export const Breadcrumb = ({ items, ...restProps }: BreadcrumbProps) => {
  return (
    <AntBreadcrumb {...restProps}>
      {items.map(item => (
        <Item {...item} />
      ))}
    </AntBreadcrumb>
  )
}
